package polymorphismlearn;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class Music {

	/**
	 * @param args
	 */
	public static void tune(Instrument t){
		t.play(Note.wlcome);
		t.test(Note.helloworld);
//		Instrument.test4();
	}
	public static Instrument[] getMusic(){
		Random r = new Random();
		Instrument l[]=new Instrument[20];
		for(int i = 0;i<20;i++){
			int count = r.nextInt(3);
			switch(count){
			case 0:l[i] = new Wind();break;
			case 1:l[i] = new Wind2();break;
			case 2:l[i] = new Wind3();break;
			default :l[i] = new Wind();
			}
		}
		return l;
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
/*		Wind w = new Wind();
		tune(w);
		Instrument.test4();
		Wind.test4();
	}*/
	/*	Instrument l[] = getMusic();
		for(int i = 0;i<l.length;i++){
			System.out.println(l[i]);
			l[i].play(Note.thankyou);
		}*/
		Instrument l = new Wind();
//		new Wind();
		Wind w = new Wind();
		w.getData();
		System.out.println(l.f);
		System.out.println(w.f);	
		Instrument i = new Wind();
		i.getObject().play(Note.helloworld);
		ArrayList al = new ArrayList();
		al.add(new Wind(100));
		System.out.println(al.get(0).getClass());
		Wind w1 =(Wind) al.get(0);
		w1.play(Note.wlcome);
		System.out.println(w1.f);
		ArrayList<Wind> al2 = new ArrayList<Wind>();
		al2.add(new Wind());
		al2.get(0).play(Note.thankyou);
		Object o = new Object();
//		Wind w2 = (Wind)o;
	}
}
